Package com.vasco.image.generator
Class ImageGeneratorSDK
- java.lang.Object
-
- com.vasco.image.generator.ImageGeneratorSDK
-
public final class ImageGeneratorSDK extends java.lang.ObjectThe Image Generator SDK main class. It can generate a QR code or a CrontoSign image.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringVERSIONVersion of the Image Generator SDK
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BWQRCodeResponsegenerateBWQRCode(int imageSize, java.lang.String inputValue, int errorCorrectionLevel)Generates a black and white QR code imagestatic java.awt.image.BufferedImagegenerateCrontoSign(int squareSize, java.lang.String inputValue)Generates a CRONTO image for the corresponding input values.static java.awt.image.BufferedImagegenerateCrontoSign(int squareSize, java.lang.String inputValue, boolean onPaper)Generates a CRONTO image for the corresponding input values.static java.awt.image.BufferedImagegenerateDynamicCrontoImage(int squareSize, java.lang.String inputValue, boolean onPaper)Generates a CRONTO image for the corresponding input values.
-
-
-
Field Detail
-
VERSION
public static final java.lang.String VERSION
Version of the Image Generator SDK- See Also:
- Constant Field Values
-
-
Method Detail
-
generateCrontoSign
public static java.awt.image.BufferedImage generateCrontoSign(int squareSize, java.lang.String inputValue) throws ImageGeneratorSDKExceptionGenerates a CRONTO image for the corresponding input values. A scrambling is applied on the input before generating the image. The output image is to be printed on paper.- Parameters:
squareSize- The size of a CrontoSign square. The minimum square size isImageGeneratorSDKConstants.CRONTOSIGN_MIN_SQUARE_SIZE, and the maximum square size isImageGeneratorSDKConstants.CRONTOSIGN_MAX_SQUARE_SIZEinputValue- The hexadecimal string to encode- Returns:
- The CRONTO image
- Throws:
ImageGeneratorSDKException- If an exception occurred, the following error code can be thrown:ImageGeneratorSDKErrorCodes.INPUT_VALUE_EMPTYif the input value is emptyImageGeneratorSDKErrorCodes.INPUT_VALUE_TOO_LONGif the input value is too longImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_HEXAif the input value is not an hexadecimal valueImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_EVENif the input length is not evenImageGeneratorSDKErrorCodes.CRONTOSIGN_SQUARE_SIZE_INVALID_VALUEif the square size is invalidImageGeneratorSDKErrorCodes.CRONTOSIGN_GENERATION_ERRORif an error occurred during the CrontoSign generationImageGeneratorSDKErrorCodes.INTERNAL_ERRORif an internal error is raised
-
generateCrontoSign
public static java.awt.image.BufferedImage generateCrontoSign(int squareSize, java.lang.String inputValue, boolean onPaper) throws ImageGeneratorSDKExceptionGenerates a CRONTO image for the corresponding input values. A scrambling is applied on the input before generating the image.- Parameters:
squareSize- The size of a CrontoSign square. The minimum square size isImageGeneratorSDKConstants.CRONTOSIGN_MIN_SQUARE_SIZE, and the maximum square size isImageGeneratorSDKConstants.CRONTOSIGN_MAX_SQUARE_SIZEinputValue- The hexadecimal string to encode. The max size isImageGeneratorSDKConstants.CRONTOSIGN_MAX_INPUT_VALUE_LENGTHonPaper- true if and only if the image is to be printed on paper- Returns:
- The CRONTO image
- Throws:
ImageGeneratorSDKException- If an exception occurred, the following error code can be thrown:ImageGeneratorSDKErrorCodes.INPUT_VALUE_EMPTYif the input value is emptyImageGeneratorSDKErrorCodes.INPUT_VALUE_TOO_LONGif the input value is too longImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_HEXAif the input value is not an hexadecimal valueImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_EVENif the input length is not evenImageGeneratorSDKErrorCodes.CRONTOSIGN_SQUARE_SIZE_INVALID_VALUEif the square size is invalidImageGeneratorSDKErrorCodes.CRONTOSIGN_GENERATION_ERRORif an error occurred during the CrontoSign generationImageGeneratorSDKErrorCodes.INTERNAL_ERRORif an internal error is raised
-
generateDynamicCrontoImage
public static java.awt.image.BufferedImage generateDynamicCrontoImage(int squareSize, java.lang.String inputValue, boolean onPaper) throws ImageGeneratorSDKExceptionGenerates a CRONTO image for the corresponding input values. The size of the image is dynamic and depends on the inputValue length. CAUTION: The CRONTO images generated with this method cannot be scanned by VASCO hardware authenticators (e.g. DP760, DP780).- Parameters:
squareSize- The size of a CrontoSign square. The minimum square size isImageGeneratorSDKConstants.CRONTOSIGN_MIN_SQUARE_SIZE, and the maximum square size isImageGeneratorSDKConstants.CRONTOSIGN_MAX_SQUARE_SIZEinputValue- The hexadecimal string to encode. The max size isImageGeneratorSDKConstants.DYNAMIC_CRONTO_IMAGE_MAX_INPUT_VALUE_LENGTHonPaper- true if and only if the image is to be printed on paper- Returns:
- The CRONTO image
- Throws:
ImageGeneratorSDKException- If an exception occurred, the following error code can be thrown:ImageGeneratorSDKErrorCodes.INPUT_VALUE_EMPTYif the input value is emptyImageGeneratorSDKErrorCodes.INPUT_VALUE_TOO_LONGif the input value is too longImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_HEXAif the input value is not an hexadecimal valueImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_EVENif the input length is not evenImageGeneratorSDKErrorCodes.CRONTOSIGN_SQUARE_SIZE_INVALID_VALUEif the square size is invalidImageGeneratorSDKErrorCodes.CRONTOSIGN_GENERATION_ERRORif an error occurred during the CrontoSign generationImageGeneratorSDKErrorCodes.INTERNAL_ERRORif an internal error is raised
-
generateBWQRCode
public static BWQRCodeResponse generateBWQRCode(int imageSize, java.lang.String inputValue, int errorCorrectionLevel) throws ImageGeneratorSDKException
Generates a black and white QR code image- Parameters:
imageSize- The side length of the generated image. The minimum image size isImageGeneratorSDKConstants.QRCODE_MIN_IMAGE_SIZE, and the maximum image size isImageGeneratorSDKConstants.QRCODE_MAX_IMAGE_SIZEinputValue- The alphanumeric string to encode. Supported values are : 0-9, A-Z (upper-case only), space, $, %, *, +, -, ., /, :errorCorrectionLevel- The error correction level (which isImageGeneratorSDKConstants.QRCODE_ERROR_CORRECTION_LEVEL_LOW,ImageGeneratorSDKConstants.QRCODE_ERROR_CORRECTION_LEVEL_MIDDLE,ImageGeneratorSDKConstants.QRCODE_ERROR_CORRECTION_LEVEL_QUALITYorImageGeneratorSDKConstants.QRCODE_ERROR_CORRECTION_LEVEL_HIGH)- Returns:
- A
BWQRCodeResponseobject containing the QR code image and the associated boolean matrix - Throws:
ImageGeneratorSDKException- If an exception occurred, the following error code can be thrown:ImageGeneratorSDKErrorCodes.INPUT_VALUE_EMPTYif the input value is emptyImageGeneratorSDKErrorCodes.INPUT_VALUE_TOO_LONGif the input value is too longImageGeneratorSDKErrorCodes.QRCODE_IMAGE_SIZE_INVALID_VALUEif the image size is invalidImageGeneratorSDKErrorCodes.QRCODE_ERROR_CORRECTION_LEVEL_INVALID_VALUEif the error correction level is invalidImageGeneratorSDKErrorCodes.INTERNAL_ERRORif an internal error is raised
-
-